package socket;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

/**
 * User: heihaier@xfuweng.com
 * Date: 2015/7/7
 * Time: 18:26
 */
public class Client {

    public static void main(String[] args) {

        try {
            Socket socket = new Socket("127.0.0.1", 3001);
            BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            String line = null;

            while ((line = br.readLine()) != null) {

                System.out.println(line);
            }

            br.close();
            socket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
